export function getPlatform() {
	let ua = navigator.userAgent.toLowerCase();
	let p = "WAP";
	if (/iphone|ipad|ipod/.test(ua)) {
		p = "I";
	} else if (/android/.test(ua)) {
		p = "A";
	}
	return p;
}

export function returnToPhoneWithData(data) {
	const p = getPlatform();
	if (p === "A") {
		window.AndroidWebView.showInfoFromJs(JSON.stringify(data));
	} else if (p === "I") {
		window.webkit.messageHandlers.jumpToOtherVc.postMessage(
			JSON.stringify(data)
		);
	}
}
